2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-10 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "jucer_SourceCodeEditor.h"
27 #include "../Application/jucer_OpenDocumentManager.h"
30 //==============================================================================
31 SourceCodeEditor::SourceCodeEditor (OpenDocumentManager::Document
* document_
,
32 CodeDocument
& codeDocument
,
33 CodeTokeniser
* const codeTokeniser
)
34 : DocumentEditorComponent (document_
),
35 editor (codeDocument
, codeTokeniser
)
37 addAndMakeVisible (&editor
);
41 font
.setTypefaceName ("Menlo Regular");
44 font
.setTypefaceName (Font::getDefaultMonospacedFontName());
46 editor
.setFont (font
);
49 SourceCodeEditor::~SourceCodeEditor()
53 void SourceCodeEditor::resized()
55 editor
.setBounds (0, 0, getWidth(), getHeight());
58 bool SourceCodeEditor::isTextFile (const File
& file
)
60 return file
.hasFileExtension ("cpp;h;hpp;mm;m;c;cc;cxx;txt;xml;plist;rtf;html;htm;php;py;rb;cs");
63 bool SourceCodeEditor::isCppFile (const File
& file
)
65 return file
.hasFileExtension (sourceOrHeaderFileExtensions
);